﻿@using Webdiyer.WebControls.Mvc

@model IPagedList<UscSunShine.Mvc.Models.RoleViewModel>
@{
    ViewBag.Title = "角色列表";
}

<h2>角色列表</h2>

<p>
    @Html.ActionLink("新建角色", "Create")
</p>

<div id="views">

    <table class="table table-hover table-striped">
        <tr>
            <th>
                @Html.Label("角色名称")
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Description)
            </th>
            <th>

            </th>
        </tr>

        @foreach (var item in Model)
    {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Description)
                </td>
                <td>
                    @Html.ActionLink("编辑角色", "Edit", new { id = item.Id }) |
                    @Html.ActionLink("角色详情", "Details", new { id = item.Id }) |
                    @Html.ActionLink("删除角色", "Delete", new { id = item.Id })
                </td>
            </tr>
    }

    </table>

    @Ajax.Pager(Model, new PagerOptions { PageIndexParameterName = "index" }, new MvcAjaxOptions { UpdateTargetId = "views", EnablePartialLoading = true })
</div>
@section Scripts{@{Html.RegisterMvcPagerScriptResource();}}